import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class TT {
	public static void main(String[] args) {
		String defaultCharsetName = Charset.defaultCharset().displayName();
		System.out.println("defaultCharsetName:" + defaultCharsetName);
		System.out.println(System.getProperty("file.encoding"));
		byte[] b = new byte[0];
		try {
			b = "2".getBytes("utf-8");
			String s = new String(b, "gbk");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		for (byte c : b) {
			System.out.println(c);
		}
		//unicode
		String z = "\u7ecf\u6d4e\u5f00\u53d1\u533a\u5e97\u4e1c\u6751\u6c38\u4e30\u6db2\u538b\u673a\u68b0\u516c\u53f8";
		System.out.println(z);//直接输出中文  经济开发区店东村永丰液压机械公司
		
		
		String n = "30";
		byte bbb=Byte.valueOf(n);
		
		System.out.println(bbb);
		
		try {
			long da= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-01-01 00:00:00").getTime();
			System.out.println(da);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	/**
	 * unicode转中文
	 * 
	 * @param str
	 * @return 中文
	 */
	public static String Unicode2GBK(String dataStr) {
		int index = 0;
		StringBuffer buffer = new StringBuffer();

		while (index < dataStr.length()) {
			if (!"//u".equals(dataStr.substring(index, index + 2))) {
				buffer.append(dataStr.charAt(index));
				index++;
				continue;
			}
			String charStr = "";
			charStr = dataStr.substring(index + 2, index + 6);

			char letter = (char) Integer.parseInt(charStr, 16);
			buffer.append(letter);
			index += 6;
		}
		return buffer.toString();
	}

	public static boolean isNeedConvert(char para) {
		return ((para & (0x00FF)) != para);
	}
}
